#include <stdio.h>
#include <stdlib.h>

void printHi(int x) {
	int i;
	for (i = 0; i < x; i++)
		printf("Hi");
	printf("\n");
}

void printHello(int x) {
	int i;
	for (i = 0; i < x; i++)
		printf("Hello");
	printf("\n");
}

//*lol = a pointer to a function of type void with an integer as its ONLY parameter
void lolwut(void (*lol)(int), int x) {
	lol(x);
}

int main() {
	int a = 5;
	printf("%i\n",a);
	int *b = &a;
	*b *= a;
	printf("%i\t%i\n",a, *b);
	a -= *b;
	printf("%i\t%i\n",a, *b);
	int c[] = {1,2,3,4,5};
	int *d;
	/*
	 * Explanation of loop below:
	 * initialization: set d equal to the location in memory of c[0]
	 * Condition: while d's location in memory is less than the location in memory of c[5]
	 * Incrementation: Increase d's location in memory by one
	 * Body: Print the value of the the location in memory d is pointing at
	 */
	for (d = &c[0]; d < &c[5]; d++) {
		printf("%i", *d);
	}
	printf("\n");
	lolwut(printHi, 3);
	lolwut(printHello, 4);
	return EXIT_SUCCESS;
}
